const Mock = require('mockjs')

module.exports = {
    'POST /login'(req, res) {
        if (req.body && req.body.username === 'admin' && req.body.password === '123456') {
            res.status(200).json(Mock.mock({
                'data': {
                    'token|30': '@character()'
                },
                'msg': '登录成功',
                'status': 200
            }))
        } else {
            res.status(400).json(Mock.mock({
                'status': 400,
                'msg': '登录失败,是你错误哦！！！',
            }))
        }
    }
}